<div class="toolbox divider nobr">
	<input type="button" id="auth_add" class="button" value="添加子类" />
	<input type="button" id="auth_mod" class="button" value="修改" />
	<input type="button" id="auth_del" class="button" value="删除" />
	<input type="button" id="auth_up"  class="button" value="上移" />
	<input type="button" id="auth_dwn" class="button" value="下移" />
	<input type="button" id="auth_act" class="button" value="控制器" />
	<input type="button" id="auth_script" class="button" value="脚本权限" />
</div>

<script type="text/javascript">
	nodemove = function(url, dataURLParams, btn){
		try {
			var request = new Request.JSON({
				url: url,
				onComplete: function(json, text) {
					if (json.error.errorcode==0){
		 				MUI.notification(json.error.retstring);
		 				MUI.updateContent({
							'element':  $('authTreePanel'),
							'url':      '/mochaui/data/auth.tree.html',
						});
						 
						$(btn).set('disabled', false);
		 			}else{
		 				MUI.notification('<font color=red>错误：</font>('+json.error.retstring+')');
		 				 $(btn).set('disabled', false);
		 			}
				}
			}).get(dataURLParams);
		} catch (ex) {
			$(btn).set('disabled', false);
			MUI.notification('<font color=red>错误：</font>访问失败('+ex.message+')');
		}
	}
	
	//authInfoPanel,authContentPanel 在auth.tree.html首次定义
	//authInfoPanel是之前的QQ面板模式, authContentPanel是现在的导航模式
	//var authInfoPanel = 'authInfoPanel';
	var authContentPanel = 'authContentPanel'	;	
	$('auth_add').addEvent('click', function(e){
		MUI.updateContent({
			'element':  $(authContentPanel),
			'url':      '/mochaui/data/auth.baseinfo.add.html',
		});
	});
	
	$('auth_mod').addEvent('click', function(e){
		MUI.updateContent({
			'element':  $(authContentPanel),
			'url':      '/mochaui/data/auth.baseinfo.mod.html',
		});
	});
	
	$('auth_del').addEvent('click', function(e){
		MUI.updateContent({
			'element':  $(authContentPanel),
			'url':      '/mochaui/data/auth.baseinfo.del.html',
		});
	});
	
	$('auth_up').addEvent('click', function(e){
		var url = '/data/sc.action';
		var dataURLParams = {"scid":"authtree_5","id":nodeinfo.id};
		nodemove(url, dataURLParams, 'auth_up');
	});
	
	$('auth_dwn').addEvent('click', function(e){
		var url = '/data/sc.action';
		var dataURLParams = {"scid":"authtree_6","id":nodeinfo.id};
		nodemove(url, dataURLParams, 'auth_dwn');
	});
	
	$('auth_act').addEvent('click', function(e){
		MUI.updateContent({
			'element':  $(authContentPanel),
			'url':      '/mochaui/data/auth.baseinfo.act.html',
		});
	});
	
	$('auth_script').addEvent('click', function(e){
		MUI.updateContent({
			'element':  $(authContentPanel),
			'url':      '/mochaui/data/auth.baseinfo.script.html',
		});
	});
	
</script>
	